var calls = 0;
window.onload = function() {
  var xhReq = createXMLHttpRequest();
  xhReq.open("GET", "countdown.phtml?start=3", true);
  xhReq.onreadystatechange = function() {
    $("response").innerHTML +=
      (++calls)+". readyState=" + xhReq.readyState
      + ".  Text="+xhReq.responseText+"<br/>";
  }
  xhReq.send(null);
}

function createXMLHttpRequest() {
  try { return new ActiveXObject("Msxml2.XMLHTTP");    } catch(e) {}
  try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}
  try { return new XMLHttpRequest();                   } catch(e) {}
  alert("XMLHttpRequest not supported");
  return null;
}
